home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / misc / GMSV03B.lha / GamesMaster / Source / E / ScreenDemos / HiResScreen.e < prev    next >
Encoding:
Text File  |  1996-09-11  |  1.8 KB  |  59 lines

  1. /* HiRes Picture Display
  2. ** ---------------------
  3. ** Opens a screen of 640 pixels width in HIRES mode.  You can even try
  4. ** SuperHiRes (SHIRES) if you change the appropriate flag in the GameScreen
  5. ** structure.
  6. */
  7.  
  8. MODULE 'games','games/games'
  9.  
  10. PROC main()
  11.    DEF screen:PTR TO gamescreen, palette:PTR TO INT, loadpic:PTR TO picture
  12.  
  13.    palette := [ $0000,$0400,$0501,$0501,$0601,$0701,$0701,$0801,
  14.         $0901,$0A01,$0B02,$0432,$0CC0,$0F00,$0211,$0880
  15.           ]:INT;
  16.  
  17.    screen :=  [    GSV1,0,
  18.         0,0,0,          -> Screen_Mem1/2/3
  19.         0,              -> Screen link.
  20.         palette,        -> Address of palette.
  21.         0,              -> Address of rasterlist.
  22.         0,              -> Amt of colours in palette.
  23.         640,256,        -> Screen Width/Height
  24.         640,256,        -> Pic Width/Height
  25.         4,              -> Amt of planes.
  26.         0,0,            -> Top of screen offsets, X/Y
  27.         0,0,            -> X/Y counters (for scrolling).
  28.         0,              -> Special attributes.
  29.         HIRES,          -> Screen mode.
  30.         INTERLEAVED,    -> Screen type
  31.         0               -> Reserved area.               
  32.           ]:gamescreen;    
  33.  
  34.    loadpic := [    PCV1,0,             -> Version header.
  35.         0,                  -> Destination.
  36.         640,256,            -> Width, Height.
  37.         4,                  -> Amount of Planes.
  38.         16,                 -> Amount of colours.
  39.         palette,            -> Palette (remap).
  40.         LORES,              -> Screen mode.
  41.         INTERLEAVED,        -> Destination.
  42.         0                   -> Parameters.
  43.               ]:picture;
  44.  
  45.    IF gmsbase := OpenLibrary('games.library',0)
  46.       SetUserPri()
  47.       IF (Add_Screen(screen) = ERR_OK)
  48.          loadpic.data := screen.memptr1;
  49.          IF (LoadPic('GAMESLIB:data/IFF.Pic640x256',loadpic) = ERR_OK)
  50.             Show_Screen(screen)
  51.         Wait_LMB()
  52.          ENDIF
  53.     Delete_Screen(screen)        
  54.       ENDIF
  55.    CloseLibrary(gmsbase)
  56.    ENDIF
  57. ENDPROC
  58.  
  59.